<?php
namespace Home\Controller;
use Think\Controller;

class JiluController extends Controller {
	public function sou(){
		$this->display();
	}
    public function select() {
    	//尝试
  //   	$destroy ="DROP VIEW  IF EXISTS `MJJL`";
		// $sql = "CREATE VIEW MJJL AS SELECT kaimenfangshi,jilu_time,zhuangtai,fang_id FROM zn_house  JOIN zn_jilu ON zn_house.fang_id=zn_jilu.house_id";
		// $Model = M();
		// $result = $Model->execute($destroy)->query($sql);
    	if (IS_POST) {
			$glModel = D("mjjl");
			$where = array();

			$diqu = $_POST["diqu"];	
			$xiaoquid = $_POST["xiaoquid"];	
			$louhao = $_POST["louhao"];	
			$danyuanid = $_POST["danyuanid"];	
			$fangjianhao = $_POST["fangjianhao"];	

			$where['diqu'] = array('eq',"$diqu");
			$where['xiaoquid'] = array('eq',"$xiaoquid");
			$where['louhao'] = array('eq',"$louhao");
			$where['danyuanid'] = array('eq',"$danyuanid");
			$where['fangjianhao'] = array('eq',"$fangjianhao");

	 		$mjjl = $glModel->where($where)->select();
	 		$this->assign('cmjl',$mjjl);
	 		$this->display();
	 	}else{
	 		$this->error("您还未输入查询条件",U("Jilu/sou"));
	 	}
    }
}
